package com.aaa.marketing.service.impl;/**
 * Date:2023/3/2
 * Author：臣哥哥
 * Description:
 */

import com.aaa.entity.CustomerIssues;
import com.aaa.marketing.dao.CustomerIssuesDao;
import com.aaa.marketing.service.CustomerIssuesService;
import com.aaa.vo.Result;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author     ：Xiaochen
 * @date       ：Created in 2023/3/2 12:00
 * @description：
 * @modified By：
 * @version:
 */
@Service
public class CustomerIssuesServiceImpl implements CustomerIssuesService {
    @Autowired
    private CustomerIssuesDao customerIssuesDao;
    @Override
    public Result selectAll(int currentPage, int pageSize, CustomerIssues customerIssues) {
        PageHelper.startPage(currentPage,pageSize);
        List<CustomerIssues> customerIssues1 = customerIssuesDao.selectAll(customerIssues);
        PageInfo<CustomerIssues> customerIssuesPageInfo = new PageInfo<>(customerIssues1);
        return new Result(2000,"成功",customerIssuesPageInfo);
    }

    @Override
    public Result update(CustomerIssues customerIssues) {
        int i = customerIssuesDao.updateById(customerIssues);
        return new Result(2000,"成功",i);
    }

    @Override
    public Result delete(Integer id) {
        int i = customerIssuesDao.deleteById(id);
        return new Result(2000,"成功",i);
    }

    @Override
    public Result insert(CustomerIssues customerIssues) {
        int insert = customerIssuesDao.insert(customerIssues);
        return new Result(2000,"成功",insert);
    }

    @Override
    public Result selectBySubmodule(CustomerIssues customerIssues) {
        List<CustomerIssues> customerIssues1 = customerIssuesDao.selectBySubmodule(customerIssues);
        System.out.println("customerIssues1 ========================== " + customerIssues1);
        return new Result(2000,"成功",customerIssues1);

    }


}